#include <stdio.h>
#include <uuid/uuid.h>
#include <stddef.h>

#include <nit/list.h>
#include <nit/gap-buf.h>

#include "../sys.h"
#include "../ser.h"

void
print_id_c(void)
{
	uuid_t id;
	int i;

	uuid_generate(id);
	printf("{");

	for (i = 0; i < 15; ++i)
		printf(" %i,", id[i]);

	printf(" %i }\n", id[i]);
}

int
main(int argc, char *argv[])
{
	Inb_cell *cell = NULL;
	Inb_sym *sym = inb_sym_new(NULL, "hello!");
	Inb_sym *sym2;
	Nit_gap gap;

	print_id_c();
	nit_gap_init(&gap, 256);

	cell = inb_cell_va(3, NULL, INB_FRM_CELL, NULL);
	inb_print(cell);
	printf("\n");

	inb_print(INB_PRD_CAR);
	printf("\n");

	/* inb_print(inb_prd_apply(INB_PRD_CAR, inb_nest(cell))); */
	/* printf("\n"); */

	/* inb_ser(&gap, INB_REL_AND); */
	/* inb_ser_print(&gap); */
	/* printf("\n"); */
	inb_ser(&gap, sym);
	sym2 = inb_deser(&gap);
	inb_print(sym2);
	/* inb_ser_print(&gap); */

	printf("\n");
}
